/* =========================================================
   Saudi National Day 96
   Desktop: 491px accordion
   Mobile: compact horizontal accordion matching supplied reference
   ========================================================= */

/* Campaign headline font already included in the UDesign fonts folder. */
@font-face {
    font-family: "SaudiND96";
    src: url("../fonts/SaudiWeb-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}
.nd96-hero-accordion,
.nd96-hero-accordion * { box-sizing: border-box; }

.nd96-banner-wrap,
.nd96-banner-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nd96-hero-accordion {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #80611f;
}

.nd96-accordion {
    --nd96-bg: #80611f;
    --nd96-bg-start: #4e3210;
    --nd96-bg-mid: #80611f;
    --nd96-bg-end: #6a4615;
    --nd96-accent: #e8c98a;
    --nd96-tab-width: clamp(28px, 2.6vw, 50px);
    position: relative;
    width: 100%;
    height: 491px;
    min-height: 491px;
    max-height: 491px;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--nd96-bg);
    background-image:
        radial-gradient(circle at 72% 34%, rgba(255,255,255,.06), transparent 31%),
        linear-gradient(112deg, var(--nd96-bg-start) 0%, var(--nd96-bg-mid) 52%, var(--nd96-bg-end) 100%);
    background-repeat: no-repeat;
    background-size: cover;
}

/* subtle depth/texture without changing campaign colours */
.nd96-accordion::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .16;
    background:
        linear-gradient(90deg, rgba(0,0,0,.18), transparent 38%, rgba(0,0,0,.08)),
        radial-gradient(circle at 74% 50%, rgba(255,255,255,.10), transparent 42%);
}

.nd96-panels {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    direction: ltr;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.nd96-panel {
    position: relative;
    flex: 0 0 var(--nd96-tab-width);
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-inline-end: 1px solid rgba(255,255,255,.12);
    overflow: hidden;
    background: transparent;
    cursor: pointer;
    transition: flex-basis .58s cubic-bezier(.22,.61,.36,1), filter .25s ease, opacity .25s ease;
    isolation: isolate;
}

.nd96-panel.is-active {
    flex: 1 1 auto;
    cursor: default;
    border-inline-end: 0;
}

.nd96-panel:focus-visible {
    z-index: 30;
    outline: 2px solid rgba(255,255,255,.96);
    outline-offset: -3px;
}

.nd96-panel:not(.is-active):hover,
.nd96-panel:not(.is-active):focus-visible {
    filter: brightness(1.08) saturate(1.08);
}

.nd96-panel-media {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 493px;
    height: 491px;
    overflow: hidden;
    pointer-events: none;
}

.nd96-panel-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none !important;
    object-fit: cover;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
}

.nd96-panel:not(.is-active)::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(0,0,0,.01), rgba(0,0,0,.13));
    pointer-events: none;
}

.nd96-copy {
    position: absolute;
    z-index: 20;
    top: 50%;
    right: clamp(34px, 4.2vw, 82px);
    width: min(44vw, 760px);
    transform: translateY(-50%);
    direction: rtl;
    text-align: right;
    color: #fff;
    pointer-events: none;
}

.nd96-campaign-logo {
    display: block;
    width: clamp(132px, 11vw, 190px);
    height: auto;
    /* In RTL the campaign mark sits on the RIGHT of the copy column. */
    margin: 0 0 18px auto;
    margin-inline-start: 0;
    margin-inline-end: auto;
    object-fit: contain;
}

.nd96-title {
    min-height: 1.35em;
    margin: 0 0 13px;
    color: #fff;
    font-family: "SaudiND96", "Saudi", "IBM Plex Sans Arabic", "IBMArabic", Tahoma, Arial, sans-serif;
    font-size: clamp(31px, 3vw, 55px);
    font-weight: 700;
    line-height: 1.24;
    letter-spacing: 0;
    text-wrap: balance;
}

.nd96-title-prefix { color: #fff; }
.nd96-typed-word { color: var(--nd96-accent); font-family: inherit; font-weight: 700; }

.nd96-typewriter-caret {
    display: inline-block;
    width: 2px;
    height: .95em;
    margin-inline-start: 5px;
    vertical-align: -.08em;
    background: var(--nd96-accent);
    animation: nd96-caret-blink .85s steps(1,end) infinite;
}

@keyframes nd96-caret-blink {
    0%, 48% { opacity: 1; }
    49%, 100% { opacity: 0; }
}

.nd96-description {
    max-width: 690px;
    min-height: 5.1em;
    margin: 0 0 23px;
    color: rgba(255,255,255,.98);
    font-family: "IBM Plex Sans Arabic", "IBMArabic", Tahoma, Arial, sans-serif;
    font-size: clamp(14px, 1.02vw, 18px);
    font-weight: 400;
    line-height: 1.78;
}

.nd96-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 13px;
    pointer-events: auto;
}

.nd96-arrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    background: rgba(20,155,88,.96);
    box-shadow: 0 5px 18px rgba(0,0,0,.12);
    cursor: pointer;
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.nd96-arrow:hover { transform: translateY(-1px) scale(1.035); background: #0f874c; }
.nd96-arrow:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.nd96-arrow span {
    width: 9px;
    height: 9px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
}
.nd96-prev span { transform: rotate(45deg); margin-left: -3px; }
.nd96-next span { transform: rotate(-135deg); margin-right: -3px; }

.nd96-dots { display: flex; align-items: center; gap: 7px; }
.nd96-dot {
    width: 9px;
    height: 9px;
    min-width: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    cursor: pointer;
    transition: transform .2s ease, background-color .25s ease;
}
.nd96-dot:hover,
.nd96-dot:focus-visible { transform: scale(1.2); }
.nd96-dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.nd96-dot.is-active { background: var(--nd96-accent); transform: scale(1.08); }

@media (min-width: 992px) and (max-width: 1279px) {
    .nd96-accordion { --nd96-tab-width: 28px; }
    .nd96-copy { right: 28px; width: 35vw; }
    .nd96-campaign-logo { width: 135px; margin-bottom: 14px; }
    .nd96-title { font-size: clamp(28px, 3vw, 38px); margin-bottom: 10px; }
    .nd96-description { font-size: 13px; line-height: 1.65; margin-bottom: 16px; }
}

/* Tablet: keep the same accordion concept, just scale it down. */
@media (max-width: 991px) {
    .nd96-accordion {
        --nd96-tab-width: clamp(10px, 1.75vw, 17px);
        height: clamp(270px, 44vw, 400px);
        min-height: 0;
        max-height: none;
        touch-action: pan-y;
    }

    .nd96-panel { flex-basis: var(--nd96-tab-width); transition-duration: .45s; }
    .nd96-panel.is-active { flex: 1 1 auto; }

    .nd96-panel-media {
        width: min(44vw, 390px);
        height: 100%;
    }

    .nd96-copy {
        right: 18px;
        width: 41vw;
    }

    .nd96-campaign-logo { width: clamp(84px, 15vw, 135px); margin-bottom: 8px; }
    .nd96-title { margin-bottom: 7px; font-size: clamp(22px, 3.6vw, 33px); line-height: 1.2; }
    .nd96-description {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 5;
        min-height: 0;
        margin-bottom: 10px;
        font-size: clamp(10px, 1.55vw, 14px);
        line-height: 1.55;
    }
    .nd96-controls { gap: 8px; }
    .nd96-arrow { width: 30px; height: 30px; min-width: 30px; }
    .nd96-arrow span { width: 7px; height: 7px; }
    .nd96-dots { gap: 5px; }
    .nd96-dot { width: 6px; height: 6px; min-width: 6px; }
}

/* Mobile reference composition:
   - campaign logo centered above artwork
   - active artwork centered
   - NEXT slide peeks from the LEFT and PREVIOUS slide peeks from the RIGHT
   - no arrow buttons on mobile (swipe + side peeks + dots are the navigation)
   - title/description below artwork exactly like the supplied reference */
@media (max-width: 767px) {
    .nd96-accordion {
        --nd96-mobile-art: min(75vw, 378px);
        --nd96-mobile-peek: min(8.5vw, 43px);
        --nd96-mobile-gap: min(4vw, 20px);
        height: clamp(555px, 151vw, 760px);
        min-height: 555px;
        max-height: 760px;
        touch-action: pan-y;
        /* Campaign backgrounds are gradients, not flat colours. */
        background-color: var(--nd96-bg);
        background-image:
            radial-gradient(circle at 50% 48%, rgba(255,255,255,.08), transparent 43%),
            linear-gradient(180deg, var(--nd96-bg-start) 0%, var(--nd96-bg-mid) 58%, var(--nd96-bg-end) 100%);
    }

    .nd96-accordion::before {
        opacity: .12;
        background:
            linear-gradient(180deg, rgba(0,0,0,.18), transparent 34%, transparent 74%, rgba(255,255,255,.05)),
            radial-gradient(circle at 50% 44%, rgba(255,255,255,.08), transparent 42%);
    }

    /* Square artwork zone. Panels are positioned like a carousel/accordion:
       previous peek on the right, active centered, next peek on the left. */
    .nd96-panels {
        top: clamp(86px, 22.8vw, 115px);
        bottom: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: var(--nd96-mobile-art);
        max-height: 378px;
        display: block;
        overflow: hidden;
        direction: ltr;
    }

    .nd96-panel,
    .nd96-panel.is-active {
        position: absolute;
        top: 0;
        left: -100%;
        width: var(--nd96-mobile-art);
        height: var(--nd96-mobile-art);
        flex: none;
        flex-basis: auto;
        border: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateZ(0);
        transition:
            left .48s cubic-bezier(.22,.61,.36,1),
            opacity .28s ease,
            filter .25s ease;
    }

    .nd96-panel.is-active {
        left: calc((100% - var(--nd96-mobile-art)) / 2);
        z-index: 5;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        cursor: default;
    }

    /* RTL visual direction from the supplied screenshot:
       NEXT is visible on the left; PREVIOUS is visible on the right. */
    .nd96-panel.is-next {
        left: calc(-1 * (var(--nd96-mobile-art) - var(--nd96-mobile-peek)));
        z-index: 3;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nd96-panel.is-prev {
        left: calc(100% - var(--nd96-mobile-peek));
        z-index: 3;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nd96-panel-media {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        overflow: hidden;
    }

    .nd96-panel-media img {
        width: 100%;
        height: 100%;
        object-fit: fill;
        object-position: center center;
    }

    .nd96-panel:not(.is-active)::after { display: none; }

    /* Copy becomes the full mobile positioning layer. */
    .nd96-copy {
        inset: 0;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        transform: none;
        text-align: center;
        direction: rtl;
        pointer-events: none;
    }

    /* “عزّنا بطبعنا” logo centered over the image. */
    .nd96-campaign-logo {
        position: absolute;
        top: clamp(16px, 3.2vw, 25px);
        left: 50%;
        width: clamp(130px, 34vw, 170px);
        height: auto;
        margin: 0;
        transform: translateX(-50%);
        object-fit: contain;
    }

    /* Text below the artwork. */
    .nd96-title {
        position: absolute;
        top: clamp(392px, 105vw, 530px);
        left: 5vw;
        right: 5vw;
        min-height: 1.35em;
        margin: 0;
        font-size: clamp(27px, 6.6vw, 38px);
        line-height: 1.22;
        text-align: center;
        white-space: normal;
    }

    .nd96-typewriter-caret {
        width: 1.5px;
        margin-inline-start: 3px;
    }

    .nd96-description {
        position: absolute;
        top: clamp(455px, 120.5vw, 610px);
        left: 5vw;
        right: 5vw;
        display: block;
        max-width: none;
        min-height: 0;
        margin: 0 auto;
        overflow: visible;
        color: rgba(255,255,255,.98);
        font-size: clamp(14px, 3.9vw, 19px);
        line-height: 1.72;
        text-align: center;
        -webkit-line-clamp: unset;
    }

    /* Mobile has NO arrows, matching the reference.
       Navigation is swipe, tappable side peeks, and dots. */
    .nd96-controls {
        position: absolute;
        inset: 0;
        display: block;
        pointer-events: none;
    }

    .nd96-arrow {
        display: none !important;
    }

    .nd96-dots {
        position: absolute;
        left: 50%;
        bottom: clamp(16px, 4.1vw, 28px);
        display: flex;
        gap: clamp(6px, 2vw, 10px);
        transform: translateX(-50%);
        pointer-events: auto;
    }

    .nd96-dot {
        width: clamp(10px, 2.8vw, 14px);
        height: clamp(10px, 2.8vw, 14px);
        min-width: clamp(10px, 2.8vw, 14px);
        background: rgba(255,255,255,.92);
    }

    .nd96-dot.is-active {
        background: #159b58;
        transform: none;
    }
}

@media (max-width: 420px) {
    .nd96-accordion { min-height: 480px; }
    .nd96-description { font-size: clamp(13px, 3.8vw, 16px); line-height: 1.68; }
}

@media (max-width: 340px) {
    .nd96-accordion { min-height: 470px; }
    .nd96-title { font-size: 24px; }
    .nd96-description { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
    .nd96-panel,
    .nd96-arrow,
    .nd96-dot { transition: none !important; }
    .nd96-typewriter-caret { animation: none !important; opacity: 1; }
}

/* =========================================================
   ND96 homepage decoration placements
   ========================================================= */
.nd96-section-separator {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background-repeat: repeat-x;
    background-position: center;
    background-size: auto 100%;
    pointer-events: none;
}

.nd96-separator--stats {
    height: clamp(20px, 2.5vw, 34px);
    background-image: url("../images/NatioanlDay/ND96/patterns/separator-after-stats.webp");
    background-color: #fff;
}
.nd96-separator--services {
    height: clamp(24px, 2.8vw, 38px);
    background-image: url("../images/NatioanlDay/ND96/patterns/separator-after-services.webp");
    background-color: #fff;
}
.nd96-separator--partners {
    height: clamp(20px, 2.5vw, 34px);
    background-image: url("../images/NatioanlDay/ND96/patterns/separator-after-partners.webp");
    background-color: #fff;
}

.nd96-news-pattern,
.announcements-section.nds-news-section {
    position: relative;
    background-color: #fff !important;
    background-image: url("../images/NatioanlDay/ND96/patterns/news-events-pattern.webp") !important;
    background-repeat: no-repeat !important;
    background-position: left top !important;
    background-size: clamp(340px, 42vw, 620px) auto !important;
}

.announcements-section.nds-news-section {
    background-color: #F9FAFB !important;
}

.nd96-news-pattern > *,
.announcements-section.nds-news-section > * {
    position: relative;
    z-index: 1;
}

/* Use the complete uploaded footer artwork ABOVE the footer at its natural ratio.
   It is intentionally outside .page-footer so the footer cannot crop it. */
.nd96-footer-pattern {
    display: block;
    width: 100%;
    height: auto !important;
    aspect-ratio: 2048 / 122;
    margin: 0;
    padding: 0;
    background-color: #0c6d38;
    background-image: url("../images/NatioanlDay/ND96/patterns/footer-top-pattern-full.webp");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
    pointer-events: none;
}

.nd96-footer-pattern + .page-footer { margin-top: 0 !important; }

@media (max-width: 991px) {
    .nd96-section-separator { background-size: auto 100%; }
    .nd96-news-pattern,
    .announcements-section.nds-news-section {
        background-size: min(72vw, 480px) auto !important;
        background-position: left top !important;
    }
}

@media (max-width: 575px) {
    .nd96-separator--stats,
    .nd96-separator--partners { height: 22px; }
    .nd96-separator--services { height: 26px; }
}

/* =========================================================
   ND96 v8 - full-bleed news artwork + separators everywhere
   ========================================================= */
/* Keep section content constrained, but let the supplied artwork span the
   complete viewport width instead of appearing as a small left-side patch. */
.nd96-news-pattern,
.announcements-section.nds-news-section {
    position: relative !important;
    isolation: isolate;
    background-image: none !important;
    overflow: visible !important;
}

.nd96-news-pattern::before,
.announcements-section.nds-news-section::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background-image: url("../images/NatioanlDay/ND96/patterns/news-events-pattern.webp");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: cover;
    pointer-events: none;
}

/* Generated separators inserted after each visible homepage section. */
.nd96-section-separator.nd96-separator--auto-1 {
    height: clamp(20px, 2.3vw, 34px);
    background-image: url("../images/NatioanlDay/ND96/patterns/separator-after-stats.webp");
    background-color: #fff;
}
.nd96-section-separator.nd96-separator--auto-2 {
    height: clamp(22px, 2.5vw, 36px);
    background-image: url("../images/NatioanlDay/ND96/patterns/separator-after-services.webp");
    background-color: #fff;
}
.nd96-section-separator.nd96-separator--auto-3 {
    height: clamp(20px, 2.3vw, 34px);
    background-image: url("../images/NatioanlDay/ND96/patterns/separator-after-partners.webp");
    background-color: #fff;
}

@media (max-width: 767px) {
    .nd96-news-pattern::before,
    .announcements-section.nds-news-section::before {
        background-position: left top;
        background-size: auto 100%;
        min-width: 100vw;
    }

    .nd96-section-separator.nd96-separator--auto-1,
    .nd96-section-separator.nd96-separator--auto-2,
    .nd96-section-separator.nd96-separator--auto-3 {
        height: 22px;
    }
}
